package com.luych.toolbox.data.service.dao;

import com.luych.toolbox.data.service.entity.DataTransporterHistoryTable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface DataTransporterHistoryTableDao extends JpaRepository<DataTransporterHistoryTable, String>, JpaSpecificationExecutor<DataTransporterHistoryTable> {

    void deleteByDataTransporterHistoryId(String dataTransporterHistoryId);

    void deleteByDataTransporterHistoryIdIn(List<String> dataTransporterHistoryIds);

    @Modifying
    @Query(value = "TRUNCATE data_transporter_history_table", nativeQuery = true)
    void truncate();

}